package days48;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class day40 {
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = scanner.nextInt();
            }
            int sum = 1;
            int[] k =new int[n];
            for (int i = 1; i < n; i++) {
                for (int j = 0; j < i; j++) {
                    if(arr[j]<arr[i]){
                        k[i] = Math.max(k[i],k[j]+1 );
                    }
                }
                sum = Math.max(sum,k[i]);
            }
            System.out.println(k[k.length-1]+1);
        }
    }

    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
    }

    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(1);
    }
}
